$("#box2").click(function () {
    $("#box1").css({
        "color": "#666"
    });
    $("#account-log").css("display", "block");
    $("#log-scan").css("display", "none");

    $(this).css({
        "color": "#E4393C"
    });
})

$("#box1").click(function () {
    $("#box2").css({
        "color": "#666"
    });
    $("#account-log").css("display", "none");
    $("#log-scan").css("display", "block");
    $(this).css({
        "color": "#E4393C"
    })
})
$("#log-code").mouseover(function () {
    $("#code-img").stop().animate({ "left": "20px" }, 500);
    $("#sas").css({ "display": "block" })
})
$("#log-code").mouseout(function () {
    $("#code-img").stop().animate({ "left": "75px" }, 500);
    $("#sas").css({ "display": "none" })
});

let loguser = document.getElementById("log-user");
let logpas = document.getElementById("log-paw");
let btn1 = document.querySelector("#lodin");
btn1.onclick = function () {

    let logus = loguser.value;
    let logps = logpas.value;
    let logAPI = "http://jx.xuzhixiang.top/ap/api/login.php";

    axios.get(logAPI, {
        params: {
            username: logus,
            password: logps
        }
    }).then(function (res) {
        //请求成功
        console.log(res.data);
        localStorage.setItem('uid',res.data.data.id);
        localStorage.setItem('token',res.data.data.token);
        if (res.data.code == 1) {
            location.href = "index.html"
        }
        
        if(res.data.code == 0){
            var arr1 = document.getElementById("arror");
            arr1.style.display = "block";
        }
    }).catch(function (err) {
        //请求失败
 
        
       
    })
};